<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%> 
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%  
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>开盘管理</title>
<link rel="stylesheet" href="css/bootstrap.css" />
<link rel="stylesheet" href="css/css.css" />
<script type="text/javascript" src="js/jquery1.9.0.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/sdmenu.js"></script>
<script type="text/javascript" src="js/laydate/laydate.js"></script>
<script src="laydate/laydate.js"></script>


</head>

<body> 
<script type="text/javascript">
var myMenu;
window.onload = function() {
	myMenu = new SDMenu("my_menu");
	myMenu.init();
};
</script>

     <div class="Switch"></div>
     <script type="text/javascript">
	$(document).ready(function(e) {
    $(".Switch").click(function(){
	$(".left").toggle();
	 
		});
});
</script>
 <script>
!function(){
laydate.skin('molv');
laydate({elem: '#Calendar'});
laydate.skin('molv');
laydate({elem: '#Calendar2'});
}();
</script>
<script>
function AllAreaExcel() 
{
    var oXL = new ActiveXObject("Excel.Application"); 
    var oWB = oXL.Workbooks.Add(); 
    var oSheet = oWB.ActiveSheet; 
    var sel=document.body.createTextRange();
    sel.moveToElementText(openingRoomTable);
    sel.select();
    sel.execCommand("Copy");
    oSheet.Paste();
    oXL.Visible = true;
}
//指定页面区域“单元格”内容导入Excel
function CellAreaExcel() 
{
    var oXL = new ActiveXObject("Excel.Application"); 
    var oWB = oXL.Workbooks.Add(); 
    var oSheet = oWB.ActiveSheet; 
    var Lenr = openingRoomTable.rows.length;
    for (i=0;i<Lenr;i++) 
    { 
        var Lenc = openingRoomTable.rows(i).cells.length; 
        for (j=0;j<Lenc;j++) 
        { 
            oSheet.Cells(i+1,j+1).value = openingRoomTable.rows(i).cells(j).innerText; 
        } 
    } 
    oXL.Visible = true; 
}
</script>

<script>
	function addroom(){
		var n = 0;
		var val;
		var che = document.getElementsByName("che");
		for(var i=0;i<che.length;i++)
			{
			if(che[i].checked){
				val = che[i].value;
				n++;
			}
			}
		if(n>1){
			alert("只能指定一条开盘报告");
		}
		if(n==0){
			alert("请指定开盘报告进行房间开盘");
		}
		if(n==1){
			window.localtion.href="openingRoomsList.jsp?openingId="+val;
		}
	}
</script>
<div class="right"  id="mainFrame">
     <div class="right_cont">
 		<ul class="breadcrumb">
 			当前位置：<a href="#">首页</a> <span class="divider">/</span>
  			<a >审核管理</a> <span class="divider">/</span>开盘管理
		</ul>
      	<div class="title_right"><span class="pull-right margin-bottom-5">
      	
      	<a class="btn btn-info btn-small" onClick="CellAreaExcel()"><i class="icon-plus icon-white"></i>打开表到excel</a>
      	
      	<a class="btn btn-info btn-small" role="button"><i class="icon-plus icon-white"></i>导入房间价格</a></span><strong>开盘管理</strong></div>
      	
    	<div id="modal-container-9735581" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="width:600px; margin-left:-300px; top:20%">
				<div class="modal-header">
					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h3 id="myModalLabel">添加开盘报告信息</h3>
		</div>
		
<!-- 弹出层部分 -->
<form name="f1" method="post" action="<%=basePath %>opening/add.action">
<div class="modal-body">
<table class="table table-bordered">
<tbody>
 	<tr>
      <td align="right">项目名称:</td>
      <td align="left"><input name="projectname" type="text"  class="span1-1" />
        [*]</td>
    </tr>
    <tr>
      <td align="right">报告名称:</td>
      <td align="left"><input name="reportname" type="text"  class="span1-1" /></td>
    </tr>
   <tr>
      <td align="right">报告类型:</td>
      <td align="left"><input name="reporttype" type="text"  class="span1-1" /></td>
    </tr>
    <tr>
      <td align="right">开盘时间:</td>
      <td align="left"><input  name="openingdate" type="text" class="laydate-icon" onclick="laydate()"/></td>
    </tr>
    <tr>
      <td align="right">计价方式:</td>
      <td align="left"><select name="valutiontype" class="span1-1">
      <option value="建筑面积">建筑面积</option>
      <option value="套内面积">套内面积</option>
      <option value="套">套</option>
      	</select>
      </td>
    </tr>
    <tr>
      <td align="right">参与调价:</td>
      <td align="left"><select name="priceadjustment" class="span1-1">
      	<option value="不参与调价">不参与调价</option>
      	<option value="参与调价">参与调价</option>
      </select>
      </td>
    </tr>
    <!-- <tr>
      <td align="right">选择开盘房间:</td>
      <td align="left"><input name="demo" type="text"  class="span1-1" /></td>
    </tr> -->
    <tr>
      <td align="right">开盘报告说明：</td>
      <td align="left"><input name="explains" type="textarea"/></td>
    </tr>
    <tr>
      <td align="right">综合折扣率：</td>
      <td align="left"><input name="compositediscount" type="text"  class="span1-1" /></td>
    </tr>
    <tr>
      <td align="right">特例折扣率：</td>
      <td align="left"><input name="specialdiscount" type="text"  class="span1-1" /></td>
    </tr>
    <tr>
     <!--  <td align="right">状态：</td> -->
      <td align="left"><input name="state" type="hidden"  value="未审核" class="span1-1" /></td>
    </tr>
  </tbody>
</table>
</div>	
<div class="modal-footer">
	
	<input type="button" value="添加" onClick="addSubmit()"/>
    <input type="reset" value="取消" />
</div>
</div>
</form>
   <!-- 显示页面的表格 -->	
<table id="openingRoomTable" class="table table-bordered table-striped table-hover" width="500">
     <tbody>
       <tr align="center">
         <td nowrap="nowrap"><strong>编号</strong></td>
         <td nowrap="nowrap"><strong>房间名称</strong></td>         
         <td nowrap="nowrap"><strong>楼层</strong></td>
         <td nowrap="nowrap"><strong>户型</strong></td>
         <td nowrap="nowrap"><strong>房间状态</strong></td>
         <td nowrap="nowrap"><strong>房间单价</strong></td>
         <td nowrap="nowrap"><strong>房间面积</strong></td>
         <td nowrap="nowrap"><strong>房间总价</strong></td>
         </tr>
       <c:forEach items="${openingRoomList}" var="opening">
       	 <tr align="center">
         	<td nowrap="nowrap">${opening.id}</td>
         	<td nowrap="nowrap">${opening.rname}</td>
         	<td nowrap="nowrap">${opening.floor}</td>
         	<td nowrap="nowrap">${opening.type}</td>
         	<td nowrap="nowrap">${opening.state}</td>
         	<td nowrap="nowrap">${opening.unitprice}</td>
         	<td nowrap="nowrap">${opening.area}</td>
         	<td nowrap="nowrap">${opening.comment1}</td>
         </tr>
       </c:forEach> 
     </tbody>
   </table>
    
   <!-- <table  class="margin-bottom-20 table  no-border" >
      <tr>
     	<td class="text-center"><input type="button" value="导出" class="btn btn-info" style="width:80px;" /></td>
     	<td class="text-center"><input type="button" value="导入" class="btn btn-info" style="width:80px;" /></td>
      </tr>
   </table> -->
   
</div>     
</div>
</div>
</body>
</html>

